from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from compsite.mainviews import index,about,visit
from django.contrib import admin
from compsite import settings
from compsite.webutils.views import picturesIniUpload,instituctionalDockUpload
admin.autodiscover()

urlpatterns=patterns('',
    # Example:
    # (r'^compsite/', include('compsite.foo.urls')),
    url(r'^$',direct_to_template,{"template":"index.html"},name='mainviews_index'),
    url(r'^academics/',direct_to_template,{"template":"conteudo.html"},name='academicos'),
    url(r'^research/',direct_to_template,{"template":"conteudo.html"},name='pesquisas'),
    url(r'^people/',direct_to_template,{"template":"conteudo.html"},name='pessoal'),
    url(r'^connect/',direct_to_template,{"template":"conteudo.html"},name='connect'),
    url(r'^general/',direct_to_template,{"template":"conteudo.html"},name='general'),
    
    url(r'^about/',about,name='mainviews_about'),
    url(r'^visit/',visit,name='mainviews_visit'),

    url(r'^news/$',include('compsite.news.urls')),
    url(r'^events/$',include('compsite.events.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    (r'^admin/doc/',include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/(.*)',admin.site.root),
    
    # URL para ser utilizada para testes
    url(r'^test/',picturesIniUpload),
)

if settings.LOCAL:
    urlpatterns+=patterns("django.views",
        url(r"^%s(?P<path>.*)/$"%settings.MEDIA_URL[1:],\
            "static.serve",\
            {"document_root": settings.MEDIA_ROOT})
    )
